﻿{% extends "gma/base.html" %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title">
        <i class="fa fa-landmark weui_grid_icon_fa" style="font-size: 32px"> </i>
        <h2> {{ guild.guild_name }} </h2>
    </h1>
    <p class="page__desc"> 成立时间: {{ guild.create_time|date:"Y-m-d" }} </p>
</div>

<div class="page__bd">
    <div class="weui-cells__title"> 公会信息 </div>
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd"> <p> <i class="fa fa-mobile-alt gm_menu_item_icon"></i> 绑定手机号码 </p> </div>
            <div class="weui-cell__ft">
                {{ guild.mobile|slice:"0:3" }}***{{ guild.mobile|slice:"-3:" }}
            </div>
        </div>

        <a class="weui-cell weui-cell_access" href="{% url 'gma:guild_members' guild.guild_id %}">
            <div class="weui-cell__bd"> <p> <i class="fa fa-users-cog gm_menu_item_icon"></i> 成员列表</p> </div>
            <div class="weui-cell__ft"> {{ total_members_count }}人 </div>
        </a>
    </div>

    <div class="weui-cells__title"> 统计数据 </div>
    <div class="weui-cells">
        <a class="weui-cell weui-cell_access" href="{% url 'gma:guild_daily_stat' guild.id %}">
            <div class="weui-cell__bd"> <p> <i class="fa fa-calendar-minus gm_menu_item_icon"></i> 每日统计 </p> </div>
            <div class="weui-cell__ft"> </div>
        </a>
        <a class="weui-cell weui-cell_access" href="{% url 'gma:guild_weekly_stat' guild.id %}">
            <div class="weui-cell__bd"> <p> <i class="fa fa-calendar-alt gm_menu_item_icon"></i> 每周统计 </p> </div>
            <div class="weui-cell__ft"> </div>
        </a>
        <a class="weui-cell weui-cell_access" href="{% url 'gma:guild_monthly_stat' guild.id %}">
            <div class="weui-cell__bd"> <p> <i class="fa fa-calendar gm_menu_item_icon"></i> 每月统计 </p> </div>
            <div class="weui-cell__ft"> </div>
        </a>
    </div>

    <div class="weui-cells__title"> 结算信息 </div>
    <div class="weui-cells">
        <a class="weui-cell weui-cell_access" href="{% url 'gma:guild_archive_list' guild.id %}">
            <div class="weui-cell__bd"> <p> <i class="fa fa-archive gm_menu_item_icon"></i> 结算记录</p> </div>
            <div class="weui-cell__ft"> </div>
        </a>
    </div>
</div>

<div class="weui-btn-area">
    <a class="weui-btn weui-btn_block weui-btn_primary" href="{% url 'gma:guild_recruit' guild.guild_id %}"> <i class="fa fa-plus-square"></i> 增加成员 </a>
    <a class="weui-btn weui-btn_block weui-btn_primary" href="{% url 'gma:bind_guild_mobile' guild.guild_id %}"> <i class="fa fa-mobile-alt"></i> 绑定手机号码 </a>
    <a class="weui-btn weui-btn_block weui-btn_warn" href="javascript:deleteGuild()"> <i class="fa fa-trash-alt"></i> 删除公会 </a>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}


<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}
<script>

function deleteGuild() {
    show_confirm_dialog('删除公会', '你确定要删除"{{ guild.guild_name }}"公会吗?', ()=> {
        let url = "{% url 'gma:api_delete_guild' %}";
        let data = {
            'guild_id': '{{ guild.id }}',
        };

        new my_ajax(url, data, '', '', () => {
            show_toast(`删除成功!`);
            setTimeout(() => {
                window.location = '{% url 'gma:guild' %}';
            }, 1000);
        });
    });
}

</script>
{% endblock extra_js %}